function initHosp(self) {
  let iData = wx.getStorageSync('idata')
  if (iData.hosp) {
    let list = self.data.hospcolumns;
    list.push({
      id: 0,
      text: '全部'
    })
    for (let i = 0; i < iData.hosp.length; i++) {
      let hosp = {}
      hosp.id = iData.hosp[i].ikey
      hosp.text = iData.hosp[i].hosp
      list.push(hosp)
    }

    self.setData({
      hospcolumns: list
    })
  }
}

function initDept(self) {
  let iData = wx.getStorageSync('idata')
  console.log(iData)
  if (iData.dept) {
    let list = self.data.kscolumns
    list.push({
      id: 0,
      text: '选择科室'
    })
    for (let i = 0; i < iData.dept.length; i++) {
      let dept = {}
      dept.id = iData.dept[i].ikey
      dept.text = iData.dept[i].dept
      list.push(dept)
    }
    self.setData({
      kscolumns: list
    })
  }
}

module.exports = {
  initHosp: initHosp,
  initDept: initDept
}